{* Smarty *}
<script type="text/javascript">
                    {php}
                        sajax_show_javascript();
                    {/php}
                    {literal}
                    // --- [ Select factories ] ---------------------
                    
                    function do_items_cb(ss)
                    {
                        var f = document.forms["productform1"];
                        var e = f.elements["list_products[]"];
                        e.options.length=0;
                    
                        if("" != ss)
                        {
                            var z = "asd"; z = ss;
                            z = z.split("~~");
                            idx = 0;
                            for (v in z)
                            {
                                vls = z[v].split("|");
                                e.options[idx++] = new Option(vls[1], vls[0]);
                            }
                        } // end if
                    }
                    
                    
                    function do_list_items()
                    {
                        s = "";
                        var f = document.forms["productform1"];
                        var e = f.elements["list_catalogs"];
                    
                        for(i=0; i<e.options.length; i++)
                        {
                            if(e.options[i].selected)
                            {
                                s += (s=="" ? "" : "|")+e.options[i].value;
                            }
                        }
                        x_GetListProducts(s, do_items_cb);
                    }
                    
                    
                    </script>

                    
                    <script type="text/javascript">
                    
                    function AddItem()
                    {
                        var f = document.forms["productform1"];
                        if(!f) 
                        {
                            alert("Unknown error!");
                            return false;
                        }
                        
                        var e1 = f.elements['list_products[]']; 
                        var e2 = f.elements['list_selected_products[]'];
                        for (i = 0; i < e1.length; i++)
                        {
                            if (e1[i].selected)
                            {
                                flag = true;
                                for (j = 0; j < e2.length; j++)
                                    if (e2[j].value == e1[i].value)
                                    {
                                        flag = false;
                                        break;
                                    }
                    
                                if (flag)
                                    e2.options[e2.length] = new Option(e1[i].text, e1[i].value);
                            }
                        }
                    }
                    
                    
                    
                    function AddCatalog()
                    {
                        var f = document.forms["productform1"];
                        if(!f) 
                        {
                            alert("Unknown error!");
                            return false;
                        }
                        
                        var e1 =  f.elements['list_catalogs'].options[f.elements['list_catalogs'].selectedIndex];
                        var e2 = f.elements['list_selected_products[]'];
                        
                        
                        if (0 != e1.value)
                        {
                            flag = true;
                            for (j = 0; j < e2.length; j++)
                                if (e2[j].value == e1.value)
                                {
                                    flag = false;
                                    break;
                                }
                    
                            if (flag)
                                e2.options[e2.length] = new Option(e1.text, e1.value);
                        }
                    }
                    
                    
                    
                    function DellItem()
                    {
                        var f = document.forms["productform1"];
                        if(!f) 
                        {
                            alert("Unknown error!");
                            return false;
                        }
                        
                        var e = f.elements['list_selected_products[]'];
                        for (i = e.length - 1; i >= 0; i--)
                        {
                            if (e[i].selected)
                            {
                                 e.options[i] = null;
                            }
                        }
                    }
                    
                    
                    function CheckData()
                    {
                        var f = document.forms["productform1"];
                        if(!f) 
                        {
                            alert("Unknown error!");
                            return false;
                        }

                        var e = f.elements['list_selected_products[]'];
                        
                        for (i = e.length - 1; i >= 0; i--)
                        {
                            e.options[i].selected = true;
                        }
                        
                    }
                    
                    
                    </script>

{/literal}

{*debug*}

{literal}
                    <script type="text/javascript">
                    function changeStatus(elt, visible) {
                        if(null == elt)
                        {
                            return;
                        }
                        if(visible==false) {
                            elt.style.display="none";
                        } else {
                            elt.style.display="inline";
                        }
                    }
                    function SetTab(method) {
                    //alert(method);
                        if(method==1) {
                            document.getElementById('a1').style.borderStyle='double';
                            document.getElementById('a2').style.borderStyle='none';
                            document.getElementById('a3').style.borderStyle='none';
                            document.getElementById('a4').style.borderStyle='none';
                            document.getElementById('a5').style.borderStyle='none';
                            document.getElementById('a6').style.borderStyle='none';                                
                            changeStatus(document.getElementById('tab1'), true);
                            changeStatus(document.getElementById('tab2'), false);
                            changeStatus(document.getElementById('tab3'), false);
                            changeStatus(document.getElementById('tab4'), false);
                            changeStatus(document.getElementById('tab5'), false);
                            changeStatus(document.getElementById('tab6'), false);
                                } 
                        if(method==2) {
                            document.getElementById('a1').style.borderStyle='none';
                            document.getElementById('a2').style.borderStyle='double';
                            document.getElementById('a3').style.borderStyle='none';
                            document.getElementById('a4').style.borderStyle='none';
                            document.getElementById('a5').style.borderStyle='none';
                            document.getElementById('a6').style.borderStyle='none';                                
                            changeStatus(document.getElementById('tab1'), false);
                            changeStatus(document.getElementById('tab2'), true);
                            changeStatus(document.getElementById('tab3'), false);
                            changeStatus(document.getElementById('tab4'), false);
                            changeStatus(document.getElementById('tab5'), false);
                            changeStatus(document.getElementById('tab6'), false);
                                } 
                        if(method==3) {
                            document.getElementById('a1').style.borderStyle='none';
                            document.getElementById('a2').style.borderStyle='none';
                            document.getElementById('a3').style.borderStyle='double';
                            document.getElementById('a4').style.borderStyle='none';
                            document.getElementById('a5').style.borderStyle='none';
                            document.getElementById('a6').style.borderStyle='none';                                
                            changeStatus(document.getElementById('tab1'), false);
                            changeStatus(document.getElementById('tab2'), false);
                            changeStatus(document.getElementById('tab3'), true);
                            changeStatus(document.getElementById('tab4'), false);
                            changeStatus(document.getElementById('tab5'), false);
                            changeStatus(document.getElementById('tab6'), false);
                                } 
                        if(method==4) {
                            document.getElementById('a1').style.borderStyle='none';
                            document.getElementById('a2').style.borderStyle='none';
                            document.getElementById('a3').style.borderStyle='none';
                            document.getElementById('a4').style.borderStyle='double';
                            document.getElementById('a5').style.borderStyle='none';
                            document.getElementById('a6').style.borderStyle='none';                                
                            changeStatus(document.getElementById('tab1'), false);
                            changeStatus(document.getElementById('tab2'), false);
                            changeStatus(document.getElementById('tab3'), false);
                            changeStatus(document.getElementById('tab4'), true);
                            changeStatus(document.getElementById('tab5'), false);
                            changeStatus(document.getElementById('tab6'), false);
                                } 
                        if(method==5) {
                            document.getElementById('a1').style.borderStyle='none';
                            document.getElementById('a2').style.borderStyle='none';
                            document.getElementById('a3').style.borderStyle='none';
                            document.getElementById('a4').style.borderStyle='none';
                            document.getElementById('a5').style.borderStyle='double';
                            document.getElementById('a6').style.borderStyle='none';                                
                            changeStatus(document.getElementById('tab1'), false);
                            changeStatus(document.getElementById('tab2'), false);
                            changeStatus(document.getElementById('tab3'), false);
                            changeStatus(document.getElementById('tab4'), false);
                            changeStatus(document.getElementById('tab5'), true);
                            changeStatus(document.getElementById('tab6'), false);
                                } 
                        if(method==6) {
                            document.getElementById('a1').style.borderStyle='none';
                            document.getElementById('a2').style.borderStyle='none';
                            document.getElementById('a3').style.borderStyle='none';
                            document.getElementById('a4').style.borderStyle='none';
                            document.getElementById('a5').style.borderStyle='none';
                            document.getElementById('a6').style.borderStyle='double';                                
                            changeStatus(document.getElementById('tab1'), false);
                            changeStatus(document.getElementById('tab2'), false);
                            changeStatus(document.getElementById('tab3'), false);
                            changeStatus(document.getElementById('tab4'), false);
                            changeStatus(document.getElementById('tab5'), false);
                            changeStatus(document.getElementById('tab6'), true);
                                } 
                        
                    }
                    </script>
                            
                      <script type="text/javascript">
              {/literal}
                        var ttls = [{foreach  name =  rows from = $item.prices  item = itm}"{$itm.title}"{if $smarty.foreach.rows.iteration != count($item.prices)},{/if}{/foreach}];
                        var prcs = [{foreach  name =  rows from = $item.prices  item = itm}"{$itm.price}"{if $smarty.foreach.rows.iteration != count($item.prices)},{/if}{/foreach}];

                        var ttls_det = [{foreach  name =  rows from = $item.prod_details  item = itm}"{$itm.title}"{if $smarty.foreach.rows.iteration != count($item.prod_details)},{/if}{/foreach}];
                        var val_det = [{foreach  name =  rows from = $item.prod_details  item = itm}"{$itm.value_det}"{if $smarty.foreach.rows.iteration != count($item.prod_details)},{/if}{/foreach}];
              {literal}
                        function InitDetails() 
                        {
                        	
                            str = "";
                          
                            for(i=0; i < ttls_det.length; i++) 
                            {
                                str += "<b>Detail "+(i + 1)+"</b>: <input id=\"ttls_det"+i+"\" type=\"text\" name=\"det_title[]\" value=\""+ttls_det[i].replace("\"", "&quot;")+"\" /> : <input id=\"val_det"+i+"\" type=\"text\" name=\"val_det[]\" value=\""+val_det[i].replace("\"", "&quot;")+"\" />  <a href=\"javascript:\" onClick=\"DelDetail("+i+");\">delete</a><br />\n";
                            }
                        
                            var obj = document.getElementById('details');
                            obj.innerHTML = str;
                            var f = document.forms["productform1"];
                            f.elements["ndetails"].value = ttls_det.length;
                          
                        
                        }
                        
                        function AddDetail() 
                        {
                        	
                            var f = document.forms["productform1"];
                            ttls_det = new Array();
                            val_det = new Array();
                    
                            for(i = 0; i < f.elements["ndetails"].value; i++) 
                            {
                                ttls_det.push(document.getElementById('ttls_det'+i).value);
                                val_det.push(document.getElementById('val_det'+i).value);
                            }
                    
                            ttls_det.push(f.elements["ent_det_title"].value);
                            val_det.push(f.elements["ent_det_val"].value);
                    
                            str = "";
                          
                            for(i = 0; i < ttls_det.length; i++) 
                            {
                                str += "<b>Detail "+(i + 1)+"</b>: <input id=\"ttls_det"+i+"\" type=\"text\" name=\"det_title[]\" value=\""+ttls_det[i].replace("\"", "&quot;")+"\" /> : <input id=\"val_det"+i+"\" type=\"text\" name=\"val_det[]\" value=\""+val_det[i].replace("\"", "&quot;")+"\" />  <a href=\"javascript:\" onClick=\"DelDetail("+i+");\">delete</a><br />\n";
                            }
                    
                            var obj = document.getElementById('details');
                            obj.innerHTML = str;
                    
                            f.elements["ndetails"].value = ttls_det.length;
                            f.elements["ent_det_title"].value = "";
                            f.elements["ent_det_val"].value = "";
                          
                        }

                        function DelDetail(idx) 
                        {
                            var f = document.forms["productform1"];
                            ttls_det = new Array();
                            val_det = new Array();
                    
                            for(i=0;i<f.elements["ndetails"].value;i++) 
                            {
                                if(i!=idx) 
                                {
                                    ttls_det.push(document.getElementById('ttls_det'+i).value);
                                    val_det.push(document.getElementById('val_det'+i).value);
                                }
                            }
                    
                            str = "";
                          
                            for(i=0; i<ttls_det.length; i++) 
                            {
                                str += "<b>Detail "+(i + 1)+"</b>: <input id=\"ttls_det"+i+"\" type=\"text\" name=\"det_title[]\" value=\""+ttls_det[i].replace("\"", "&quot;")+"\" /> : <input id=\"val_det"+i+"\" type=\"text\" name=\"val_det[]\" value=\""+val_det[i].replace("\"", "&quot;")+"\" />  <a href=\"javascript:\" onClick=\"DelDetail("+i+");\">delete</a><br />\n";
                            }
                    
                            var obj = document.getElementById('details');
                            obj.innerHTML = str;
                    
                            f.elements["ndetails"].value = ttls_det.length;
                          
                        }
                        function Init() 
                        {
                        	
                            str = "";
                          
                            for(i=0; i < ttls.length; i++) 
                            {
                                str += "<b>Price "+(i + 1)+"</b>: <input id=\"ttls"+i+"\" type=\"text\" name=\"p_title[]\" value=\""+ttls[i].replace("\"", "&quot;")+"\" /> : <input id=\"prcs"+i+"\" type=\"text\" name=\"p_price[]\" value=\""+prcs[i]+"\" />  <a href=\"javascript:\" onClick=\"DelPrice("+i+");\">delete</a><br />\n";
                            }
                        
                            var obj = document.getElementById('prices');
                            obj.innerHTML = str;
                            var f = document.forms["productform1"];
                            f.elements["nprices"].value = ttls.length;
                          
                        }
					</script>
              {/literal}

<div class="title">{$title}</div>   
<table width="678">
    <tr class="light">
        <td colspan="2" align="1center">                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--style="border-style:{if $tab == 6} double; {else} none; {/if}"-->
        <a  href="#" onClick="javascript: SetTab(1); "><img id="a1" src="img/b1.gif" border='0' ></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a  href="#" onClick="javascript: SetTab(2); "><img id="a2" src="img/b2.gif" border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a  href="#" onClick="javascript: SetTab(3); "><img id="a3" src="img/b3.gif" border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a  href="#" onClick="javascript: SetTab(4); "><img id="a4" src="img/b4.gif" border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a  href="#" onClick="javascript: SetTab(5); "><img id="a5" src="img/b5.gif" border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a  href="#" onClick="javascript: SetTab(6); "><img id="a6" src="img/b6.gif" border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        </td>
    </tr>
</table >  &nbsp;<br>

<!-- -------------------------- TAB general   -->

<div id="tab1" style="display: {if $tab == 1} inline; {else} none; {/if}">
  <form  name="productform1" method="POST" action="{$url}&parent_id={$smarty.get.parent_id}&id={$id}">
  <input type="hidden" name="parent_id" value="{$parent_id}">
    <table width="678">    
        <tr class="dark"><td>Catalog Id</td><td>{$item.catalog_id}</td></tr>
        <input name="id" type="hidden" value="{$item.catalog_id}">
        <!--<tr class="light"><td>Parent Id</td><td>{$parent_string}</td></tr>-->
        <tr class="dark">
            <td>Title</td>
            <td><input name="title" value="{$item.title}" class="input_text" type="text" style="width:350px;" /></td>
        </tr>

    <tr class="dark">

        <td valign="top">HTML title:</td>

        <td><input type="text" name="h_title" value="{$item.h_title}" class="input_text" style="width:350px;" /></td>

    </tr>

        <tr class="light">
            <td>Item number</td>
            <td><input name="item_number" value="{$item.item_number}" class="input_text" type="text" style="width:350px;" /></td>
        </tr>   
        <tr class="dark">
            <td>Catalog</td>
            <td>{$catalog_hs}</td>
        </tr>

    <tr class="light">
        <td>Low-price<br />for attachment</td>
        <td><input name="list_price" value="{if $item.list_price < 0}{$item.list_price*-1}{else}{$item.list_price}{/if}" class="input_text" type="text" style="width:350px;" />
	<input style="border:none;" class="input_text" {if $item.list_price > 0}checked{/if} name="price_list_on" type="checkbox" value="y" /> <font size='1'> (enabled) </font>
	</td>
    </tr>

    <tr class="dark">
        <td>Item Price <br /></td>
        <td><input name="our_price" value="{if $item.our_price < 0}{$item.our_price*-1}{else}{$item.our_price}{/if}" class="input_text" type="text" style="width:350px;" />
	<input style="border:none;background-color:#ddeeff;" {if $item.our_price > 0 or $item.our_price == 'null' or $item.our_price == ''}checked{/if} name="price_our_on" type="checkbox" value="y" /> <font size='1'> (enabled) </font> 
</td>
    </tr>

        <tr class="light" valign="top">
            <td>Short Description</td>
            <td>
            {*$stexteditor*}
            <textarea name="short_desc" wrap="virtual" class="input_text" style="height:50px;width:550px;">{$item.short_desc}</textarea>
            </td>
        </tr>

        <!--<tr class="dark" valign="top">
	
            <td>Available warranty <br /></td>
            <td><table border='0' cellpadding='0' cellspacing='0'><tr class="dark"><td>

 <select name="warrantyes[]" multiple="multiple" style='border:none;background-color: #ddeeff;' >
		<option value='' {if $all_pw eq ''} selected {/if}><b>------[NO WARRANTY]------</b></option>
	{foreach from=$warantyes item=w}
		<option value='{$w.warrantytype_id}' {foreach from=$all_pw item=p}{if $p.catalog_item_id == $id and $p.warranty_type_id == $w.warrantytype_id} selected {/if} {/foreach} >{$w.warrantytype_name}:${$w.warrantytype_price}</option>
	{/foreach}
  </select>  
            </td>

		</tr>
		</table>
		</td>
        </tr>
        
        <tr class="dark" valign="top">
	
            <td>Item <br />has an attachment :</td>
            <td><table border='0' cellpadding='0' cellspacing='0'><tr class="dark"><td>

 <select name="attachment" style='border:none;background-color: #ddeeff;' >
		<option value='' {if $all_pw == ''} selected {/if}><b>------[WITHOUT ATTACHMENT]------</b></option>
	{foreach from=$attch_catalog item=w}
		<option value='{$w.catalog_id}' {if $attch == $w.catalog_id} selected {/if}>{$w.title}</option>
	{/foreach}
  </select>  
            </td>

		</tr>              
		</table>
		</td>
        </tr>-->

    <tr class="dark">
        <td valign="top">Owned by Vendor:</td>
	<td><select name="owned_by_vendor" class="input_text">
	{if $def_vendor_id > 0}
	<option value="{$def_vendor_id}">{$def_vendor_name}</option>
	{/if}
	<option value="0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No vendor</option>
	{foreach from=$vendors item=v}
	<option value="{$v.vendor_id}" {if $item.owned_by_vendor eq $v.vendor_id} selected {/if}>{$v.vendor_name}</option>
	{/foreach}
	</select>
	</td>
    </tr>

        <tr class="light">
            <td>Vendors #</td>
            <td><input name="vendor_catalog_key" value="{$item.vendor_catalog_key}" class="input_text" type="text" style="width:150px;" /></td>
        </tr>   


        <tr class="light">
            <td valign="top">Description</td>
            <td>
            {$ftexteditor}
            <textarea name="description" wrap="virtual" class="input_text" style="height:150px;width:550px;">{$item.description}</textarea>
            </td>
        </tr>
        
        <tr class="light">
            <td valign="top">Item Details<br /></td>
            <td>
                <div id="details" name="details"></div>
                <input type="hidden" name="ndetails" value="" />
                <table>
                <tr>
                    <td>Title: </td>
                    <td><input type="text" name="ent_det_title" value="" /></td>
                </tr>
                <tr>
                    <td>Detail: </td>
                    <td><input type="text" name="ent_det_val" value="" /></td>
                </tr>
                </table>
                <input type="button" value="Add new detail" onClick="javascript: AddDetail();" /><br />
            </td>
        </tr>

   <!-- <tr class="dark">

    <td>Item Metal</td>
    <td>
    <select name="metal" >
    <option value="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No metal</option>
    {foreach from=$metal item=metl}
    <option value="{$metl.metal_name}" {if $item.metal eq $metl.metal_name} selected {/if}> {$metl.metal_name} </option>
    {/foreach}
    </select>
    </td>
        </tr>-->

      <!--  <tr class="dark">
            <td valign="top">Group with</td>
            <td>
                <table class="light">
                <tr>
                    <td colspan="3">
                        <select name="list_catalogs" class="input_text" style="width : 240px" onChange="javascript : do_list_items();">
                            <option value="0">None</option>
                            {foreach from = $arr_catalogs item = catalog}
                                <option value="{$catalog.catalog_id}">{$catalog.title}</option>
                            {/foreach}
                        </select>
                        &nbsp;&nbsp;&nbsp;
                        <input class="button" type="button" value="&gt;&gt;" align="left" onClick="javascript : AddCatalog();" />
                    </td>
                </tr>
                <tr>
                <td>
                    <select name="list_products[]" class="input_text" size="10" style="width : 240px" multiple>
                    {foreach from = $arr_products_root  item = product}
                        <option value="{$product.catalog_id}">{$product.title}</option>
                    {/foreach}
                    </select>
                </td>

                <td>
                    <input class="button" type="button" value="&gt;&gt;" onClick="javascript : AddItem();" />
                    <br />
                    <br />
                    <br />
                    <input class="button" type="button" value="&lt;&lt;" onClick="javascript : DellItem();" />
                </td>

                <td>
                    <select name="list_selected_products[]" class="input_text" size="10" style="width : 240px" multiple>
                    {foreach from = $arr_selected_products  item = product}
                        <option value="{$product.catalog_id}">{if "Y" != $product.is_category}{$product.item_number}-{/if}{$product.title}</option>
                    {/foreach}
                    </select>
                </td>
                </tr>
                </table>
            </td>
        </tr>-->

        <tr class="light">
            <td>Store</td>
            <td>
                <table border="0" class="light">
                <tr>
                    <td>Quantity:
                    </td>
                    <td>         
                         <div style="background-color: #dfffef; border: solid 1px #3997FF; text-decoration: none;width:77; height:21;" align="right" >
                            <b>{$qty} &nbsp;</b>
                        </div>
                    </td>
                    <td>
                        &nbsp;&nbsp;&nbsp; Add: 
                        <input name="add" type="text" value="" class="input_text" size="10" align="right" >
                        &nbsp;&nbsp; {$result_qty}&nbsp;&nbsp;&nbsp;
                    
                    </td>
                    <td>
                     <input  type="button" value=" View Store History " class="button" size="10" align="right" onclick="window.location.href='?path=orderslist,productlist&page=store_history&id={$item.catalog_id}'">
                    </td>
                </tr>
                </table>
            </td>
        </tr>
        <tr class="dark">
            <td>Is Active</td>
            <td><input name="is_active" {if $item.is_active eq 'Y'}checked{/if} type="checkbox"/>
            </td>
        </tr>
        
    </table >
    
        <input name="catalog_id" value="{$id}" type="hidden"/>
        <input name="tab" value="1" type="hidden">
        <input name="action" value="{$action}" type="hidden"/>
        <br>    
    &nbsp;&nbsp;  <input type="submit" value=" Submit ''General'' " class="button" />
    &nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" class="button" onclick="location = '{$cancel_url}';">
    </form> 
</div> 

<!-- -------------------------- TAB img   -->

<div id="tab2" style="display: {if $tab == 2} inline; {else} none; {/if}">
  <form  name="productform2" method="POST" action="{$url}&parent_id={$smarty.get.parent_id}&id={$id}" enctype="multipart/form-data" >
  <input type="hidden" name="parent_id" value="{$parent_id}">
	{if $item.is_active eq 'Y'}<input type="hidden" name="is_active" value="on">{/if}
    <table width="678">    
        <tr class="dark" valign="top">
            <td >Image Small <br> (catalog preview) <br /><span style="color: #0033F5">(Recomended size: 100x100)</span>  {if isne($item.img_small) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_small&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td>
            <input type="file" name="img_small" value="{$item.img_small}" class="input_text" size="55"/><br/>
            {if isne($item.img_small) }<img src="/inventory/{$item.img_small}" border="0"/>{else}No Image{/if}
            </td>
        </tr>
        <tr class="dark" valign="top">
            <td >Image Large <br /><span style="color: #0033F5"> (Recomended size: 250x250)</span>{if isne($item.img_large) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_large&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td>
            <input type="file" name="img_large" value="{$item.img_large}" class="input_text" size="55"/><br/>
            {if isne($item.img_large) }<img src="/inventory/{$item.img_large}" border="0"/>{else}No Image{/if}
            </td>
        </tr>
        <tr class="dark" valign="top">
            <td >Image Hires <br /><span style="color: #0033F5"> (Recomended size: 400x400)</span>{if isne($item.img_hires) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_hires&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td>
            <input type="file" name="img_hires" value="{$item.img_hires}" class="input_text" size="55"/><br/>
            {if isne($item.img_hires) }<img src="/inventory/{$item.img_hires}" border="0"/>{else}No Image{/if}
            </td>
        </tr>
        
        <tr class="light">
            <td valign="top">Image View 1 large <br /><span style="color: #0033F5"> (Recomended size: 250x250)</span> {if isne($item.img_large1) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_large1&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td><input type="file" name="img_large1" value="{$item.img_large1}" class="input_text"/ size="76"><br/>
                    {if isne($item.img_large1) }<img src="/inventory/{$item.img_large1}" border="0"/>{else}No Image{/if}
            </td>
        </tr>
        <tr class="light">
            <td valign="top">Image View 1 hires <br /><span style="color: #0033F5"> (Recomended size: 400x400)</span> {if isne($item.img_hires1) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_hires1&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td><input type="file" name="img_hires1" value="{$item.img_hires1}" class="input_text" size="77"/><br/>
                    {if isne($item.img_hires1) }<img src="/inventory/{$item.img_hires1}" border="0"/>{else}No Image{/if}
            </td>
        </tr>
        <tr class="dark">
            <td valign="top">Image View 2 large <br /><span style="color: #0033F5">  (Recomended size: 250x250)</span> {if isne($item.img_large2) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_large2&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td><input type="file" name="img_large2" value="{$item.img_large2}" class="input_text" size="76"/><br/>
                    {if isne($item.img_large2) }<img src="/inventory/{$item.img_large2}" border="0"/>{else}No Image{/if}
            </td>
        </tr>
        <tr class="dark">
            <td valign="top">Image View 2 hires <br /><span style="color: #0033F5"> (Recomended size: 400x400)</span> {if isne($item.img_hires2) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_hires2&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td><input type="file" name="img_hires2" value="{$item.img_hires2}" class="input_text" size="77"/><br/>
                    {if isne($item.img_hires2) }<img src="/inventory/{$item.img_hires2}" border="0"/>{else}No Image{/if}
            </td>
        </tr>
        <tr class="light">
            <td valign="top">Image View 3 large <br /><span style="color: #0033F5"> (Recomended size: 250x250)</span> {if isne($item.img_large3) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_large3&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td><input type="file" name="img_large3" value="{$item.img_view1_small}" class="input_text" size="76"/><br/>
                    {if isne($item.img_large3) }<img src="/inventory/{$item.img_large3}" border="0"/>{else}No Image{/if}
            </td>
        </tr>
        <tr class="light">
            <td valign="top">Image View 3 hires <br /><span style="color: #0033F5"> (Recomended size: 400x400)</span> {if isne($item.img_hires3) }<br><br><a href="{$url}&page=edit&id={$id}&del_img=img_hires3&tab=2" style="text-decoration: none;"><div align="center" valign="center" style="width:65; height:22;background-color: #ffdfff; border: solid 1px #3997FF; ">delete</div></a>{/if}</td>
            <td><input type="file" name="img_hires3" value="{$item.img_hires3}" class="input_text" size="77"/><br/>
                    {if isne($item.img_hires3) }<img src="/inventory/{$item.img_hires3}" border="0"/>{else}No Image{/if}
            </td>
        </tr>

    </table >     
    
        <input name="catalog_id" value="{$id}" type="hidden"/>
        <input name="tab" value="2" type="hidden">
        <input name="parent_id" value="{if isne($item.parent_id)}{$item.parent_id}{else}{$parent_id}{/if}" type="hidden"/>
        <input name="action" value="{$action}" type="hidden"/>
        <br>    
    &nbsp;&nbsp;  <input type="submit" value=" Submit ''Image'' " class="button" />
    &nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" class="button" onclick="location = '{$cancel_url}';">
    </form>
</div> 
    
<!-- -------------------------- TAB about   -->

<div id="tab3" style="display: {if $tab == 3} inline; {else} none; {/if}">
  <form  name="productform3" method="POST" action="{$url}&parent_id={$smarty.get.parent_id}&id={$id}"  >
  <input type="hidden" name="parent_id" value="{$parent_id}">
    <table width="678">    
           <tr class="light">
            <td align="center">
                {$fck_editor_about}
            </td>
        </tr>
    </table >
    
        <input name="catalog_id" value="{$id}" type="hidden"/>
        <input name="tab" value="3" type="hidden">
        <input name="action" value="{$action}" type="hidden"/>
        <br>
     &nbsp;&nbsp;  <input type="button" value=" Edit ''About'' " class="button" onclick="window.location.href='?path=orderslist,productlist&page=edit_about&id={$id}';"/>    
    &nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" class="button" onclick="location = '{$cancel_url}';">
    </form>     
</div> 

<!-- -------------------------- TAB how to    -->

<div id="tab4" style="display: {if $tab == 4} inline; {else} none; {/if}">
  <form  name="productform4" method="POST" action="{$url}&parent_id={$smarty.get.parent_id}&id={$id}"  >
  <input type="hidden" name="parent_id" value="{$parent_id}">
    <table width="678">    
           <tr class="light">
            <td>
                {$fck_editor_how_to_use}
            </td>
        </tr>
    </table >     
    
        <input name="catalog_id" value="{$id}" type="hidden"/>
        <input name="tab" value="4" type="hidden">
        <input name="action" value="{$action}" type="hidden"/>
        <br>    
     &nbsp;&nbsp;  <input type="button" value=" Edit ''How to'' " class="button" onclick="window.location.href='?path=orderslist,productlist&page=edit_howto&id={$id}';"/>
    &nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" class="button" onclick="location = '{$cancel_url}';">
    </form>
</div> 

<!-- -------------------------- TAB FAQ   -->

<div id="tab5" style="display: {if $tab == 5} inline; {else} none; {/if}">
    <table width="678">    
           <tr class="dark">
            <td>
                {$faq_list}
            </td>
        </tr>
    </table >     
    {$result_faq}
        <input name="catalog_id" value="{$id}" type="hidden"/>
        <input name="tab" value="5" type="hidden">
        <input name="action" value="{$action}" type="hidden"/>
        &nbsp;&nbsp;
    <form name="add_faq" method='post' action='{$url}&tab=5&action=add_faq'>
	<input type="hidden" name="parent_id" value="{$parent_id}">
        <!--<input type="hidden" name="action" value="add_faq">-->
        <input type="hidden" name="id" value="{$id}">
        <input type='submit' value='Add new FAQ' class="button">
        &nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" class="button" onclick="location = '{$cancel_url}';">
    </form>
    
</div> 

<!-- -------------------------- TAB   Testimonials   -->

<div id="tab6" style="display: {if $tab == 6} inline; {else} none; {/if}">
    <table width="678">    
           <tr class="dark">
            <td >
                {$testimonials_list}
            </td>
        </tr>
    </table >     
    {$result_testimonials}
        <input name="catalog_id" value="{$id}" type="hidden"/>
        <input name="tab" value="6" type="hidden">
        <input name="action" value="{$action}" type="hidden"/>
        &nbsp;&nbsp;
    <form name="add_testimon" method='post' action='{$url}&tab=6&action=add_testimon'>
	<input type="hidden" name="parent_id" value="{$parent_id}">
        <!--<input type="hidden" name="action" value="add_faq">-->
        <input type="hidden" name="id" value="{$id}">
        <input type='submit' value='Add new Testimonial' class="button">
        &nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" class="button" onclick="location = '{$cancel_url}';">
    </form>
    
</div> 
        <script language="javascript">InitDetails();</script>